﻿#include <string>
#include <iostream>

using namespace std;

class Solution {
public:
	bool isPalindrome(int x) 
	{
		string tmp;
		if (x < 0)
		{
			return false;
		}
		int y = std::abs(x);
		while (y != 0)
		{
			tmp.push_back('0' + y % 10);
			y = y / 10;
		}
		for (string::size_type i = 0; i < tmp.length()/2; ++i)
		{
			if (tmp[i] != tmp[tmp.length() - i - 1])
			{
				return false;
			}
		}
		return true;
	}
};

int main()
{
	Solution s;
	cout << s.isPalindrome(-2147447412) << endl;
	return 0;
}